package com.bite.blog.utils;

import com.fasterxml.jackson.core.format.DataFormatDetector;
import lombok.Setter;

import java.text.SimpleDateFormat;
import java.util.Date;

public class DateFormatUtils {

    private static final String DEFAULT_FORMAT = "yyyy-MM-dd HH:mm:ss";

    @Setter
    private static String currentFormat = DEFAULT_FORMAT;

    public static String formatDate(Date date) {
        return new SimpleDateFormat(currentFormat).format(date);
    }
}
